<template>
  <div class="xc-home">
    <TopTitle2 />
    <van-dropdown-menu>
      <van-dropdown-item v-model="value1" :options="option1" />
    </van-dropdown-menu>
    <router-view />
  </div>
</template>

<script setup lang="ts">
import { ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import TopTitle2 from "../../Components/TopTitle2.vue"

const router = useRouter()
const value1 = ref(0)

const option1 = [
  { text: '巡课任务', value: 0 },
  { text: '巡寝任务', value: 1 },
  { text: '导师育人记录', value: 2 },
  { text: '教师结队记录', value: 3 }
]

watch(value1, (newValue) => {
  if (newValue === 0) {
    router.push('/lsrw/xkrw')
  } else if (newValue == 1){
    router.push('/lsrw/xqrw')
  } else if (newValue == 2){
    router.push('/lsrw/dsyrjl')
  } else if (newValue == 3){
    router.push('/lsrw/jsjdjl')
  }
})
</script>

<style scoped>
.xc-home {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
</style>